package com.lansi.card.bean;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

public class Card implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Integer id;
	private String cardid;
	private String sn;
	private String name;
	private Integer major;
	private Integer minor;
	private Integer Inteval;
	private String power;
	private String powerStr;
	private Integer batterycap;
	private Integer batteryleft;
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	private Date usetime;
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	private Date replacetime;
	private String memo;
	
	public Card() {
		super();
	}

	public Card(Integer id, String cardid, String sn, String name, Integer major, Integer minor, Integer inteval,
			String power, String powerStr, Integer batterycap, Integer batteryleft, Date usetime, Date replacetime,
			String memo) {
		super();
		this.id = id;
		this.cardid = cardid;
		this.sn = sn;
		this.name = name;
		this.major = major;
		this.minor = minor;
		Inteval = inteval;
		this.power = power;
		this.powerStr = powerStr;
		this.batterycap = batterycap;
		this.batteryleft = batteryleft;
		this.usetime = usetime;
		this.replacetime = replacetime;
		this.memo = memo;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getCardid() {
		return cardid;
	}

	public void setCardid(String cardid) {
		this.cardid = cardid;
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getMajor() {
		return major;
	}

	public void setMajor(Integer major) {
		this.major = major;
	}

	public Integer getMinor() {
		return minor;
	}

	public void setMinor(Integer minor) {
		this.minor = minor;
	}

	public Integer getInteval() {
		return Inteval;
	}

	public void setInteval(Integer inteval) {
		Inteval = inteval;
	}

	public String getPower() {
		return power;
	}

	public void setPower(String power) {
		this.power = power;
	}

	public String getPowerStr() {
		return powerStr;
	}

	public void setPowerStr(String powerStr) {
		this.powerStr = powerStr;
	}

	public Integer getBatterycap() {
		return batterycap;
	}

	public void setBatterycap(Integer batterycap) {
		this.batterycap = batterycap;
	}

	public Integer getBatteryleft() {
		return batteryleft;
	}

	public void setBatteryleft(Integer batteryleft) {
		this.batteryleft = batteryleft;
	}

	public Date getUsetime() {
		return usetime;
	}

	public void setUsetime(Date usetime) {
		this.usetime = usetime;
	}

	public Date getReplacetime() {
		return replacetime;
	}

	public void setReplacetime(Date replacetime) {
		this.replacetime = replacetime;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((Inteval == null) ? 0 : Inteval.hashCode());
		result = prime * result + ((batterycap == null) ? 0 : batterycap.hashCode());
		result = prime * result + ((batteryleft == null) ? 0 : batteryleft.hashCode());
		result = prime * result + ((cardid == null) ? 0 : cardid.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((major == null) ? 0 : major.hashCode());
		result = prime * result + ((memo == null) ? 0 : memo.hashCode());
		result = prime * result + ((minor == null) ? 0 : minor.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((power == null) ? 0 : power.hashCode());
		result = prime * result + ((powerStr == null) ? 0 : powerStr.hashCode());
		result = prime * result + ((replacetime == null) ? 0 : replacetime.hashCode());
		result = prime * result + ((sn == null) ? 0 : sn.hashCode());
		result = prime * result + ((usetime == null) ? 0 : usetime.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Card other = (Card) obj;
		if (Inteval == null) {
			if (other.Inteval != null)
				return false;
		} else if (!Inteval.equals(other.Inteval))
			return false;
		if (batterycap == null) {
			if (other.batterycap != null)
				return false;
		} else if (!batterycap.equals(other.batterycap))
			return false;
		if (batteryleft == null) {
			if (other.batteryleft != null)
				return false;
		} else if (!batteryleft.equals(other.batteryleft))
			return false;
		if (cardid == null) {
			if (other.cardid != null)
				return false;
		} else if (!cardid.equals(other.cardid))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (major == null) {
			if (other.major != null)
				return false;
		} else if (!major.equals(other.major))
			return false;
		if (memo == null) {
			if (other.memo != null)
				return false;
		} else if (!memo.equals(other.memo))
			return false;
		if (minor == null) {
			if (other.minor != null)
				return false;
		} else if (!minor.equals(other.minor))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (power == null) {
			if (other.power != null)
				return false;
		} else if (!power.equals(other.power))
			return false;
		if (powerStr == null) {
			if (other.powerStr != null)
				return false;
		} else if (!powerStr.equals(other.powerStr))
			return false;
		if (replacetime == null) {
			if (other.replacetime != null)
				return false;
		} else if (!replacetime.equals(other.replacetime))
			return false;
		if (sn == null) {
			if (other.sn != null)
				return false;
		} else if (!sn.equals(other.sn))
			return false;
		if (usetime == null) {
			if (other.usetime != null)
				return false;
		} else if (!usetime.equals(other.usetime))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Card [id=" + id + ", cardid=" + cardid + ", sn=" + sn + ", name=" + name + ", major=" + major
				+ ", minor=" + minor + ", Inteval=" + Inteval + ", power=" + power + ", powerStr=" + powerStr
				+ ", batterycap=" + batterycap + ", batteryleft=" + batteryleft + ", usetime=" + usetime
				+ ", replacetime=" + replacetime + ", memo=" + memo + "]";
	}
	
	
}
